<?php
add_theme_support('menus');

add_theme_support('post-thumbnails');

add_image_size('slideshow-home',900,350);

add_image_size('slideshow-single',900,350, true);

add_image_size('destaque-home-single',267,242);

add_image_size('destaque-home-double',552,242);

add_image_size('posts-recents',200,150, true);

register_sidebar(array('name'=>'sidebar','id'=>'sidebar','description'=>'Sidebar','before_widget'=>'<div id="%1$s" class="%2$s">','after_widget'=>'</div>','before_title'=>'<h3 class="widget-title">','after_title'=>'</h3>'));

function resumo($string, $tamanho, $encode = 'UTF-8') {
    if( strlen($string) > $tamanho )
        $string = mb_substr($string, 0, $tamanho - 3, $encode) . '[...]';
    else
        $string = mb_substr($string, 0, $tamanho, $encode);
 
    return $string;
}

function searchfilter($query) {

    if ($query->is_search && !is_admin() ) {
        $query->set('post_type',array('post'));
    }

return $query;
}
?>